import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/comment',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/comment/body-shape',
          name: 'body-shape',
          component: () => import('./views/comment/BodyShape.vue')
        },
        {
          path: '/comment/physical-fitness',
          name: 'physical-fitness',
          component: () => import('./views/comment/PhysicalFitness.vue')
        }
      ]
    },
    {
      path: '/course',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/course/index',
          name: 'index',
          component: () => import('./views/course/Index.vue')
        }
      ]
    },
    {
      path: '/prescription',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/prescription/index',
          name: 'index',
          component: () => import('./views/prescription/Index.vue')
        }
      ]
    },
    {
      path: '/article',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/article/index',
          name: 'index',
          component: () => import('./views/article/Index.vue')
        }
      ]
    },
    {
      path: '/consult',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/consult/type',
          name: 'type',
          component: () => import('./views/consult/Type.vue')
        },
        {
          path: '/consult/question',
          name: 'type',
          component: () => import('./views/consult/Question.vue')
        }
      ]
    },
    {
      path: '/help',
      component: () => import('./views/layout/Layout.vue'),
      children: [
        {
          path: '/help/index',
          name: 'type',
          component: () => import('./views/help/Index.vue')
        }
      ]
    },
    {
      path: '/',
      name: 'home',
      component: () => import('./views/layout/Layout.vue')
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    }
  ]
})
